home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / playavi / !PlayAVI / Swis < prev    next >
Text File  |  1994-09-15  |  6KB  |  161 lines

  1. !playAVI (AVI film player) v1.4
  2. ⌐ Paul Gardiner (31 July 1994).
  3.  
  4. Some versions of PlayAVI can be controlled via a SWI interface. These
  5. versions include in the application directory a module called AVIControl.  To
  6. obtain normal interactive behaviour, comment out from the !Run file the line
  7. that loads AVIControl. (WARNING: your version may have been compiled to
  8. prohibit interactive use.)
  9.  
  10. Most of the SWIs have no immediate effect. Instead they leave a message with
  11. the control module, which the player will act upon when the controlling
  12. program returns to its poll loop.  The SWI that validates a file is an
  13. exception, in that it analises the file immediately, delivering its report on
  14. return.  AVI_On also acts immediately.
  15.  
  16. Here are two ways to use the interface that should avoid problems:
  17.  
  18. Method 1.
  19.  
  20.    * call AVI_On and AVI_Run
  21.    * for each film
  22.      * check film with AVI_Validate, which returns the picture size
  23.      * set position with AVI_Place
  24.      * load film with AVI_Load
  25.      * enter poll loop monitoring AVI_Status, waiting for not busy
  26.    * call AVI_Off when you've seen enough films
  27.  
  28. Method 2.
  29.  
  30.    * call AVI_On and AVI_Run
  31.    * take a film
  32.      * check film with AVI_Validate, which returns the picture size
  33.      * set position with AVI_Place
  34.      * load film with AVI_Load
  35.    * return to poll loop, forgetting about the playing film
  36.    * when you feel like playing another film
  37.      * check film with AVI_Validate, which returns the picture size
  38.      * ensure the players operational and empty with AVI_On and AVI_Eject
  39.      * set position with AVI_Place
  40.      * load film with AVI_Load
  41.    * return again to poll loop, forgetting about the playing film
  42.    * call AVI_Off when you've had enough   
  43.  
  44. Before attempting to use the SWI interface, the main application should be
  45. invoked, by callin the !Run file. This will load the module and also run
  46. momentarily a program that primes the module. After this the SWIs listed
  47. below are available. Each one preserves all registers except those specified
  48. to return a result.
  49.  
  50. AVI_On         &484C0      Load the player
  51.  
  52.     A call to this SWI is necessary before most of the other SWIs will work.
  53.     The main application is loaded with a default, comfortable setting of
  54.     the volume, the film rack empty (of course), and the player not running.
  55.     Multiple calls to AVI_On are safe in that they do not cause multiple
  56.     copies of the player to be loaded.
  57.     
  58.  
  59. AVI_Off        &484C1      Quit the player
  60.  
  61.     This can be called at any stage of playing films.  It is wise to call
  62.     it when the player is not to be used fo a while, since the death of the
  63.     main application returns the most significant part of the used memory
  64.     to the WIMP.  It is planned at some stage to make the player kinder in
  65.     its use of memory, where upon it will be unnecessary to call AVI_Off
  66.     until the controlling application has no further use for it.
  67.     
  68.  
  69. AVI_Validate   &484C2      Interogate a film
  70.  
  71.     On entry:  R0  -  pointer to the filename, represented as a control
  72.                       terminated string.
  73.                     
  74.                R1  -  36 byte buffer for returned record.
  75.                
  76.                
  77.     On exit:   !(R1 + 0)   report code
  78.                !(R1 + 4)   4 byte compressor code
  79.                !(R1 + 8)   4 byte format code
  80.                !(R1 + 12)  planes info (two 16 bit words)
  81.                !(R1 + 16)  Width in pixels
  82.                !(R1 + 20)  Height in pixels
  83.                !(R1 + 24)  Frame rate expressed in time units (see next word)
  84.                !(R1 + 28)  Number of time units in a second
  85.                !(R1 + 32)  Number of frames
  86.                
  87.     The report code may be    0 - Playable
  88.                               1 - NotSupported
  89.                               2 - NotRecognised
  90.                               3 - NotOpenable
  91.                               
  92.     xsize and ysize should be multiplied by 4 to give OS units.
  93.  
  94.     
  95.  
  96. AVI_Load       &484C3      Load a named film into the rack
  97.  
  98.     On entry:  R0  -  pointer to the filename, represented as a control
  99.                       terminated string.
  100.  
  101.     There is some difficulty involved in loading more than a single film.
  102.     If AVI_Load is called several times by the controlling program between
  103.     polling the WIMP, then only the last call is acted upon.  Worse is the
  104.     fact that a single poll of the WIMP may not be sufficient for the
  105.     player to be allowed to act on a request.  It is probably best when
  106.     using this current version to work with one film at a time.  Calls
  107.     to AVI_Status can determine if the rack is empty or not.
  108.     
  109. AVI_Eject      &484C4      Empty the rack
  110.  
  111.     This SWI will eject all films.  You may have no cause to call this SWI
  112.     because films are automatically ejected when the rack of films has run
  113.     to completion.  If AVI_Load and AVI_Eject (in either order) are called
  114.     without an intermediate poll of the WIMP, the rack will be left
  115.     containing just the one film specified by the load.
  116.     
  117.  
  118. AVI_Place      &484C5      Position the top, left corner of the viewing
  119.                            window.
  120.                            
  121.     On entry:  R0  -  x coordinate in OS units.
  122.                R1  -  y coordinate in OS units.
  123.     
  124.     The new position is maintained until this SWI is called again or until
  125.     the next call to AVI_Off, which ever is the sooner.
  126.          
  127.  
  128. AVI_Volume     &484C6      Set the volume.
  129.  
  130.     On entry:  R0  -  volume from 1 to 127
  131.  
  132.     The new volume is maintained until this SWI is called again or until
  133.     the next call to AVI_Off, which ever is the sooner.
  134.     
  135.  
  136. AVI_Run        &484C7      Set the player running.
  137.  
  138.     This call can be made before or after loading a film.  All subsequently
  139.     loaded films will play immediately, until a call is made to AVI_Stop
  140.     or AVI_Off.
  141.     
  142.     
  143. AVI_Stop       &484C8      Countermand AVI_Run.
  144.  
  145.  
  146. AVI_SingleTask &484C9      Move between desktop and singel-task modes.
  147.  
  148.     On entry: R0 - 0         for desktop mode
  149.                  - nonzero   for single-task mode
  150.  
  151.  
  152. AVI_Status     &484CA
  153.  
  154.     On exit:  R0 - operational flag (the main application is operating)
  155.               R1 - busy flag        (there is a film currently loaded)
  156.               R2 - running flag     (the player is running, or would if it
  157.                                      had a film in it)
  158.               R3 - volume           (value from 1 to 127)
  159.  
  160.     If waiting for a film to stop, look at the busy flag.
  161.